#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'测试'

from urllib import request
import json


def fetch_data(url):
    with request.urlopen(url) as f:
        data = f.read().decode('utf-8')
    return json.loads(data)


# 测试
URL = 'https://api.douban.com/v2/book/2129650'
data = fetch_data(URL)
print(data)
assert data['tags'][0]['count'] == 23
print('ok')
